/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package drt;

import evaluation.Graph;
import java.util.Map;
import logic.Type;

/**
 *
 * @author phong
 */
public class DrtEntityVariable extends DrtVariable implements DrtEntity {
    
    public DrtEntityVariable(String name) {
        super(name, Type.ENTITY_TYPE);
    }   
    
    @Override
    public DrtEntityVariable simplify() {
        return this;
    }
    
    @Override
    public DrtEntityVariable replace(DrtVariable var, DrtExpression exp) {
        if (this.equals(var)) {
            if (exp instanceof DrtEntityVariable)
                return (DrtEntityVariable)exp;
            else if (exp instanceof DrtVariable)
                return new DrtEntityVariable(((DrtVariable)exp).getName());
            else 
                throw new Error("incorrect object class");
        }
        else 
            return this;
    }

    @Override
    public Graph toGraph() {
        return new Graph();
    }
    
    @Override
    public DrtEntityVariable getTemplate(Map<String,String> map) {
        return this;
    }
}
